package com.pro.service.imple;

import com.pro.dao.ConversationMapper;
import com.pro.service.ConversationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: ConversationServiceImple
 * @Author: 笑笑
 * @DATE: 2021/11/16
 * @TIME: 下午 08:35
 */
@Service
public class ConversationServiceImple implements ConversationService {
    @Autowired
    private ConversationMapper conversationMapper;

    //查看所有数据展示表
    @Override
    public List<ConversationMapper> getTable() {
        return conversationMapper.getTable();
    }

    //根据id查看会话记录
    @Override
    public ConversationMapper getRecord(Integer id) throws Exception {
        if (id == null && id < 1){
            throw new Exception("id");
        }
        return conversationMapper.getRecord(id);
    }

    //根据id删除会话记录
    @Override
    public Boolean deleteRecord(Integer id) throws Exception {
        if (id == null && id < 1){
            throw new Exception("id");
        }
        return conversationMapper.deleteRecord(id);
    }
}
